import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '测试状态',
    align:"center",
    dataIndex: 'testStatus'
   },
   {
    title: '订单号',
    align:"center",
    dataIndex: 'orderNo'
   },
   {
    title: '工程号',
    align:"center",
    dataIndex: 'gc'
   },
   {
    title: '批次号',
    align:"center",
    dataIndex: 'pc'
   },
   {
    title: '产品编码',
    align:"center",
    dataIndex: 'testItemNo'
   },
   {
    title: '产品名称',
    align:"center",
    dataIndex: 'testProdName'
   },
   {
    title: '工序号',
    align:"center",
    dataIndex: 'sequenceNo'
   },
   {
    title: '测试产品编码',
    align:"center",
    dataIndex: 'testProdNo'
   },
   {
    title: '测试软件代号',
    align:"center",
    dataIndex: 'testSoftCode'
   },
   {
    title: '测试仪器编号',
    align:"center",
    dataIndex: 'testInstrumentNo'
   },
   {
    title: '测试仪器名称',
    align:"center",
    dataIndex: 'testInstrumentName'
   },
   {
    title: '测试条件',
    align:"center",
    dataIndex: 'testCondition'
   },
   {
    title: '测试内容',
    align:"center",
    dataIndex: 'testContent'
   },
   {
    title: '测试说明',
    align:"center",
    dataIndex: 'testExplain'
   },
   {
    title: '当前测试产品数量',
    align:"center",
    dataIndex: 'testQty'
   },
   {
    title: '当前cpu的计数频率',
    align:"center",
    dataIndex: 'curCpuFrequency'
   },
   {
    title: '测试人员',
    align:"center",
    dataIndex: 'testUser'
   },
   {
    title: '检验人员',
    align:"center",
    dataIndex: 'inspectUser'
   },
   {
    title: '测试时间',
    align:"center",
    dataIndex: 'testTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '检验结论',
    align:"center",
    dataIndex: 'testConclusion'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '预留列1',
    align:"center",
    dataIndex: 'commentCol1'
   },
   {
    title: '预留列2',
    align:"center",
    dataIndex: 'commentCol2'
   },
   {
    title: '创建人',
    align:"center",
    dataIndex: 'createBy'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '更新人',
    align:"center",
    dataIndex: 'updateBy'
   },
   {
    title: '更新日期',
    align:"center",
    dataIndex: 'updateTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '测试主表主键',
    field: 'id',
    component: 'Input',
  },
  {
    label: '测试状态',
    field: 'testStatus',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入测试状态!'},
          ];
     },
  },
  {
    label: '订单号',
    field: 'orderNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入订单号!'},
          ];
     },
  },
  {
    label: '工程号',
    field: 'gc',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工程号!'},
          ];
     },
  },
  {
    label: '批次号',
    field: 'pc',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入批次号!'},
          ];
     },
  },
  {
    label: '产品编码',
    field: 'testItemNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入产品编码!'},
          ];
     },
  },
  {
    label: '产品名称',
    field: 'testProdName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入产品名称!'},
          ];
     },
  },
  {
    label: '工序号',
    field: 'sequenceNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工序号!'},
          ];
     },
  },
  {
    label: '测试产品编码',
    field: 'testProdNo',
    component: 'Input',
  },
  {
    label: '测试软件代号',
    field: 'testSoftCode',
    component: 'Input',
  },
  {
    label: '测试仪器编号',
    field: 'testInstrumentNo',
    component: 'Input',
  },
  {
    label: '测试仪器名称',
    field: 'testInstrumentName',
    component: 'Input',
  },
  {
    label: '测试条件',
    field: 'testCondition',
    component: 'Input',
  },
  {
    label: '测试内容',
    field: 'testContent',
    component: 'Input',
  },
  {
    label: '测试说明',
    field: 'testExplain',
    component: 'Input',
  },
  {
    label: '当前测试产品数量',
    field: 'testQty',
    component: 'Input',
  },
  {
    label: '当前cpu的计数频率',
    field: 'curCpuFrequency',
    component: 'Input',
  },
  {
    label: '测试人员',
    field: 'testUser',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入测试人员!'},
          ];
     },
  },
  {
    label: '检验人员',
    field: 'inspectUser',
    component: 'Input',
  },
  {
    label: '测试时间',
    field: 'testTime',
    component: 'DatePicker',
  },
  {
    label: '检验结论',
    field: 'testConclusion',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '预留列1',
    field: 'commentCol1',
    component: 'Input',
  },
  {
    label: '预留列2',
    field: 'commentCol2',
    component: 'Input',
  },
  {
    label: '创建人',
    field: 'createBy',
    component: 'Input',
  },
  {
    label: '创建日期',
    field: 'createTime',
    component: 'Input',
  },
  {
    label: '更新人',
    field: 'updateBy',
    component: 'Input',
  },
  {
    label: '更新日期',
    field: 'updateTime',
    component: 'Input',
  },
];
//子表单数据
//子表表格配置
export const testValueColumns: JVxeColumn[] = [
    {
      title: '测试系表主键',
      key: 'id',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '测试主表主键',
      key: 'testMainId',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '检验项目',
      key: 'examineProject',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '检测项目名称',
      key: 'examineProjectDescription',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '规格标准',
      key: 'defectStandard',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '规格下限',
      key: 'lowerLimit',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '规格上限',
      key: 'upperLimit',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '检测值',
      key: 'defectValue',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '测量计量单位编码',
      key: 'unitOfMeasure',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '计量方式（1-计数 2-计量 3-判定）',
      key: 'measureMethod',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '检测结果（0-合格 1-不合格）',
      key: 'defectResult',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '检验结论',
      key: 'defectCon',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '要求条件',
      key: 'valueTerm',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '产品编码',
      key: 'prodNo',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '预留列1',
      key: 'commentCol1',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '预留列2',
      key: 'commentCol2',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '创建人',
      key: 'createBy',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '创建日期',
      key: 'createTime',
      type: JVxeTypes.datetime,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '更新人',
      key: 'updateBy',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '更新日期',
      key: 'updateTime',
      type: JVxeTypes.datetime,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]
export const testFilesColumns: JVxeColumn[] = [
    {
      title: '测试文件主键',
      key: 'id',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '测试主表主键',
      key: 'testMainId',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '文件或目录名称',
      key: 'fileName',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '1：目录 2：文件',
      key: 'fileType',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '文件大小',
      key: 'fileSize',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '文件的MD5校验值',
      key: 'fileMd5',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '绝对路径',
      key: 'filePath',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '项目中的路径',
      key: 'fileUrl',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'Doc Node id',
      key: 'fileBucketsId',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'Parent Node id',
      key: 'filePid',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'fileCreator',
      key: 'fileCreator',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'Doc CreateTime',
      key: 'fileCreateTime',
      type: JVxeTypes.date,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'latestEditor',
      key: 'latestEditor',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'latestEditTime',
      key: 'latestEditTime',
      type: JVxeTypes.date,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '状态：可用1，不可用0',
      key: 'available',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '排序码',
      key: 'ordernum',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'spread',
      key: 'spread',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: ' 上传人id',
      key: 'creatorId',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '后缀名',
      key: 'fileExt',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '文件字符串',
      key: 'fileString',
      type: JVxeTypes.textarea,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '创建人',
      key: 'createBy',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '创建日期',
      key: 'createTime',
      type: JVxeTypes.datetime,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '更新人',
      key: 'updateBy',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '更新日期',
      key: 'updateTime',
      type: JVxeTypes.datetime,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]
